package cn.dxs.gitee;

import android.text.TextUtils;

import java.util.Arrays;
import java.util.List;

/**
 * app参数配置文件
 *
 * @author lijian
 * @date 2019-09-21 18:42
 */
public class AppConfig {

    public static final String GITEE_API_BASE_URL = "https://api.github.com/";

    public static final int HTTP_TIME_OUT = 32 * 1000;// http请求超时的时长
    public static final int HTTP_MAX_CACHE_SIZE = 32 * 1024 * 1024;// http的缓存大小
    public static final int CACHE_MAX_AGE = 4 * 7 * 24 * 60 * 60;// http的缓存时长

    public static final List<String> COMMON_PAGE_URL_LIST = Arrays.asList(
            "https://github.com/trending"
    );

    public static final boolean isCommonPageUrl(String url) {
        if (TextUtils.isEmpty(url)) {
            return false;
        }
        for (String commonUrl : COMMON_PAGE_URL_LIST) {
            if (url.contains(commonUrl)) {
                return true;
            }
        }
        return false;
    }
}
